<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<body>
 <form id="functionForm">
     <input type="hidden" id="parentId" name="parentId" th:value="${sysFunction['parentId']}" th:default="0"/>
     <input type="hidden" id="id" name="id" th:value="${sysFunction['id']}" th:default="0"/>
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-content">
                <div class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 权限名称</label>
                        <div class="col-sm-10">
                            <input class="form-control validate-data" type="text" id="functionName" name="functionName" th:value="${sysFunction['functionName']}"/>
                            <span class="help-block m-b-none c-999">权限名称 限30个字以内</span>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><i class="c-red">*</i> 权限类型</label>
                        <div class="col-sm-10">
                            <div class="input-group" style="width: 100%">
                                <select data-placeholder="选择权限类型..." class="chosen-select-no-search validate-data" style="width: 100%;" tabindex="1" id="functionType" name="functionType">
                                    <option th:if="${level} lt 3" th:selected="${sysFunction['functionType']} eq '1'" value="1">菜单</option>
                                    <option th:selected="${sysFunction['functionType']} eq '2'" value="2">功能</option>
                                </select>
                            </div>
                            <span class="help-block m-b-none c-999">选择所属权限类型</span>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label text-right">权限地址（URL）</label>
                        <div class="col-sm-10">
                            <input class="form-control" type="text" id="functionUrl" name="functionUrl" th:value="${sysFunction['functionUrl']}"/>
                            <span class="help-block m-b-none c-999">请输入权限对应的地址。非一级权限该字段为必填</span>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"> 是否在工作台显示</label>
                        <div class="col-sm-10">
                            <div class="input-group" style="width: 100%">
                                <select data-placeholder="选择工作台显示方式..." class="chosen-select-no-search validate-data" style="width: 100%;" tabindex="1" id="showIndex" name="showIndex">
                                    <option th:selected="${sysFunction['showIndex']} eq '1'" value="1">否</option>
                                    <option th:selected="${sysFunction['showIndex']} eq '2'" value="2">是</option>
                                </select>
                            </div>
                            <span class="help-block m-b-none c-999">选择所属权限类型</span>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">是否在左则菜单显示</label>
                        <div class="col-sm-10">
                            <div class="input-group" style="width: 100%">
                                <select data-placeholder="请选择..." class="chosen-select-no-search validate-data" style="width: 100%;" tabindex="1" name="leftShow">
                                    <option th:selected="${sysFunction['leftShow']} eq '0'" value="0">不显示</option>
                                    <option th:selected="${sysFunction['leftShow']} eq '1'" value="1">显示</option>
                                </select>
                            </div>
                            <span class="help-block m-b-none c-999">选择所属权限类型</span>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group work-type">
                        <label class="col-sm-2 control-label">
                            <i class="c-red">*</i>
                            工作台显示区</label>
                        <div class="col-sm-10">
                            <div class="input-group" style="width: 100%">
                                <select data-placeholder="选择工作台显示区..." class="chosen-select-no-search" style="width: 100%;" tabindex="1" id="workType" name="workType">
                                    <option  value="0">选择工作台显示区</option>
                                    <option th:selected="${sysFunction['workType']} eq '1'" value="1">运营支持</option>
                                    <option th:selected="${sysFunction['workType']} eq '2'" value="2">内容提供</option>
                                    <option th:selected="${sysFunction['workType']} eq '3'" value="3">系统准备</option>
                                </select>
                            </div>
                            <span class="help-block m-b-none c-999">选择工作台类型</span>
                        </div>
                    </div>
                    <div class="hr-line-dashed work-type"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label text-right">权限图标样式</label>
                        <div class="col-sm-10">
                            <input class="form-control" type="text" id="iconClass" name="iconClass" placeholder="权限的图标样式" th:value="${sysFunction['iconClass']}"/>
                            <span class="help-block m-b-none c-999">权限的图标样式</span>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 默认排序</label>
                        <div class="col-sm-10">
                            <input class="form-control validate-data" type="text" id="sort" th:value="${sysFunction['sort']}" th:default="0" name="sort">
                            <span class="help-block m-b-none c-999">数字越小越靠前</span>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label text-right">权限说明</label>
                        <div class="col-sm-10">
                            <textarea class="form-control" rows="5" style="resize: none; overflow: auto" id="depict" name="depict" placeholder="权限的说明信息" maxlength="255" th:text="${sysFunction['depict']}"></textarea>
                            <span class="help-block m-b-none c-999">权限的说明信息。最多输入255个字符</span>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label text-right">重要信息说明</label>
                        <div class="col-sm-10">
                            <textarea class="form-control" rows="5" style="resize: none; overflow: auto" id="majorInfo" name="majorInfo" placeholder="重要信息说明" th:text="${sysFunction['majorInfo']}"></textarea>
                            <span class="help-block m-b-none c-999">重要信息说明</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
<script th:inline="javascript" type="text/javascript">
    var showIndex = [[${sysFunction['showIndex']}]];
    $(function(){
        //初始化下拉框的搜索输入,如果不重新初始化下拉框样式不加载
        initSelectSearch();
        if(showIndex==1 || showIndex==null){
            $(".work-type").addClass("hide");
        }
        $("body").on('change',"#showIndex",function () {
            var showIndex = $(this).val();
            if(showIndex==1){//否
                $(".work-type").addClass("hide");
            }else{//是
                $(".work-type").removeClass("hide");
            }
        });
    });
</script>
</body>
</html>